Combine a doubly linked list for O(1) eviction ordering with a hashmap for O(1) lookup, protected by a sync.RWMutex. For extreme throughput, use sharded locks or a library like ristretto.
Sharded locks: partition key space into N buckets, each with its own mutex — reduces contention
sync.Map: suitable for read-heavy workloads with infrequent writes
ristretto (DGraph): production-grade cache with TTL, admission policy, and metrics
groupcache: distributed caching for multi-node setups
Always benchmark with realistic concurrency before choosing between mutex and sync.Map